package com.ra.coupon;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

import com.espirit.eap.sa.LoginUser;
import com.googlecode.cswish.annotation.cm;
import com.ra.landlord.LandlordUser;

/**
 * 优惠券
 * 
 * @author colin
 * 
 */
@Entity
public class Coupon {

	private Integer id;

	@cm("券名称")
	private String name;
	
	@cm("券类别")
	private Integer type;
	
	@cm("券金额")
	private BigDecimal amount;
	
	@cm("最低消费（使用条件）")
	private BigDecimal valueLow;
	
	@cm("使用条件说明")
	private String conditionDesc;
	
	//1:平台；2：商家
	@cm("来源类别")
	private Integer sourceType;
	
	//如果是商家，则此处为品牌公寓的id
	@cm("来源方")
	private Integer sourceId;
	
	@cm("说明")
	private String remark;
	
	@cm("所属活动")
	private String activity;
	
	@cm("创建时间")
	private Date createTime;
	
	@cm("创建人")
	private LoginUser createUser;
	
	@Id
	@GeneratedValue
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public BigDecimal getAmount() {
		return amount;
	}

	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}

	public BigDecimal getValueLow() {
		return valueLow;
	}

	public void setValueLow(BigDecimal valueLow) {
		this.valueLow = valueLow;
	}

	public String getConditionDesc() {
		return conditionDesc;
	}

	public void setConditionDesc(String conditionDesc) {
		this.conditionDesc = conditionDesc;
	}

	public Integer getSourceType() {
		return sourceType;
	}

	public void setSourceType(Integer sourceType) {
		this.sourceType = sourceType;
	}

	public Integer getSourceId() {
		return sourceId;
	}

	public void setSourceId(Integer sourceId) {
		this.sourceId = sourceId;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getActivity() {
		return activity;
	}

	public void setActivity(String activity) {
		this.activity = activity;
	}
	
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	public LoginUser getCreateUser() {
		return createUser;
	}

	public void setCreateUser(LoginUser createUser) {
		this.createUser = createUser;
	}
}
